home *** CD-ROM | disk | FTP | other *** search
- Path: news.spies.com!usenet
- From: Erik Max Francis <max@alcyone.com>
- Newsgroups: comp.lang.c
- Subject: Re: beginner question
- Date: Sun, 31 Mar 1996 19:49:46 -0800
- Organization: Alcyone Systems
- Message-ID: <315F525A.4A1CD496@alcyone.com>
- References: <4jc3sr$1ggu@uvaix3e1.comp.UVic.CA> <4jdo7l$de2@sparcserver.lrz-muenchen.de> <315AFED2.7466@willows.com>
- NNTP-Posting-Host: newton.alcyone.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i486)
-
- Tarang Deshpande wrote:
-
- > So then what does the following mean:
- >
- > struct _FOO
- > {
- > int bar;
- > } FOO;
- >
- > struct _FOO s1;
- > FOO s2;
- >
- > Why?
-
- This is a compiler error.
-
- struct _FOO { int bar; } FOO;
-
- declares a structure called struct _FOO and an instance of that structure FOO.
- The further declaration
-
- FOO s2;
-
- and is tantamount to saying
-
- int x, y;
- x y;
-
- What you're probably _actually_ seeing is
-
- typedef struct _FOO { int bar; } FOO;
-
- which defines the type FOO which is an alias for struct _FOO.
-
- --
- Erik Max Francis &tSftDotIotE && http://www.alcyone.com/max && max@alcyone.com
- San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
- H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
- Omnia quia sunt, lumina sunt. && Dominion, GIGO, GOOGOL, Omega, Psi, Strategem
- "Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_
-